﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediaBusiness.Common
{
    /// <summary>
    /// 资源标签
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class PermissionActionAttribute : System.Attribute
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">权限名称 请优先使用ResourceActionType对象里面预定义的值</param>
        public PermissionActionAttribute(string name)
        {
            Name = name;

        }

        /// <summary>
        /// 动作名称,如果不设置默认为方法名称
        /// 如果多个方法的action一样，需要合并
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 操作描述
        /// </summary>

        public string Summary { get; set; }

        /// <summary>
        /// 默认权限 如果是allow的话，则未设置也直接由权限
        /// </summary>
        public PermissionStatus DefaultPermission { get; set; }

        /// <summary>
        /// 定制的资源名称，不受ResourceAttribute控制,不填写则默认为ResourceAttribute的值
        /// </summary>
        public string CustomerResource { get; set; }
    }
}
